﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MVC.Web.UI.Accordion
{
    public class ContentItemBuilder : IContentItemBuilder<ContentItemBuilder>
    {

        private WebAccordionCollection<NavigationItem> _items;

        private NavigationItem _item = null;

        public ContentItemBuilder(WebAccordionCollection<NavigationItem> collection)
        {
            this._items = collection;
            this._item = new ContentItem();

            _items.Add(this._item);
           
        }

        public IContentItemBuilder<ContentItemBuilder> Name(string name)
        {
            this._item.Name = name;
            return this;
        }

        public IContentItemBuilder<ContentItemBuilder> Content(Func<ContentItemBuilder, System.Web.WebPages.HelperResult> content)
        {
            this._item.Content = content(this);
            return this;
        }


        public IContentItemBuilder<ContentItemBuilder> Content(Action action)
        {
            throw new NotImplementedException();
        }
    }
}
